/* tslint:disable */
/* eslint-disable */
/**
 * Admin.NET 通用权限开发平台
 * 让 .NET 开发更简单、更通用、更流行。整合最新技术，模块插件式开发，前后端分离，开箱即用。<br/><u><b><font color='FF0000'> 👮不得利用本项目从事危害国家安全、扰乱社会秩序、侵犯他人合法权益等法律法规禁止的活动！任何基于本项目二次开发而产生的一切法律纠纷和责任，我们不承担任何责任！</font></b></u>
 *
 * OpenAPI spec version: 1.0.0
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios';
import { Configuration } from '../configuration';
import { OrderinfoPageInput } from '../models/order-page-input';
import { AdminResultOrderinfo, OrderinfoPagedResult } from '../models/result-pagelist-orderinfo';
import { DeleteOrderinfoInput, OrderInfo } from '../models/order-input';

import { axiosInstance, serveConfig } from '../../utils/axios-utils';

const BaseUrl=(window as any).__env__.VITE_API_URL
// Some imports not used depending on template conditions
// @ts-ignore


/**
 * SysWechatUserApi - axios parameter creator
 * @exports
 */
export const OrderinfoApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 获取出库订单
         */
        apiOrderinfoPagePost: async (body?: OrderinfoPageInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/orderInfo/getOrderPageList`;
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;

            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
            }

            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },

        /**
         * 增加出库订单
        */
        apiOrderinfoAddPost: async (body?: OrderInfo, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `api/orderInfo/InsertOrderInfo`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;
            }
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };

        },

        /**
         * 修改出库订单
         */
        apiOrderinfoUpdatePost: async (body?: OrderInfo, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/orderInfo/UpdateOrderInfo`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);


            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            };
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;

            }
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };

        },

        /**
         * 删除出库订单
         */
        apiOrderinfoDeletePost: async (body?: DeleteOrderinfoInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/api/orderInfo/DeleteOrder`;
            const localVarUrlObj = new URL(localVarPath, serveConfig.basePath);


            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            };
            const localVarRequestOptions: AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options };
            const localVarHeaderParameter = {} as any;
            // 添加认证
            if (configuration && configuration.accessToken) {
                const accessToken = typeof configuration.accessToken === 'function'
                    ? await configuration.accessToken()
                    : await configuration.accessToken;
                localVarHeaderParameter["Authorization"] = "Bearer " + accessToken;


            };
            localVarHeaderParameter['Content-Type'] = 'application/json-patch+json';
            localVarRequestOptions.headers = { ...localVarHeaderParameter, ...options.headers };
            localVarRequestOptions.data = JSON.stringify(body || {});
            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };


        },
    };
}
/**
 * 
 * @param configuration 
 * @returns 
 */
export const apiOrderinfoApiFp = function (configuration?: Configuration) {
    return {
        /**
         * 获取出库订单
         */
        async apiOrderinfoPagePost(
            body?: OrderinfoPageInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultOrderinfo>>> {
            const localVarAxiosArgs = await OrderinfoApiAxiosParamCreator(configuration).apiOrderinfoPagePost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 增加出库订单
         */
        async apiOrderinfoAddPost(
            body?: OrderInfo,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await OrderinfoApiAxiosParamCreator(configuration).apiOrderinfoAddPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 修改出库订单
         */        async apiOrderinfoUpdatePost(
            body?: OrderInfo,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await OrderinfoApiAxiosParamCreator(configuration).apiOrderinfoUpdatePost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        /**
         * 删除出库订单
         * 
         * 
         */        async apiOrderinfoDeletePost(
            id?: DeleteOrderinfoInput,
            options?: AxiosRequestConfig
        ): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await OrderinfoApiAxiosParamCreator(configuration).apiOrderinfoDeletePost(id, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs: AxiosRequestConfig = { ...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url };
                return axios.request(axiosRequestArgs);
            };
        },

        // ... existing code ...    

    };
};

/**
 * WarehouseApi - object-oriented interface
 * @export
 * @class WarehouseApi
 * @extends {BaseAPI}
 */
export class OrderinfoApi extends BaseAPI {
    /**
     * 
     * @summary 获取出库订单
     * @param {OrderinfoPageInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiOrderinfoPagePost(body?: OrderinfoPageInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultOrderinfo>> {
        return apiOrderinfoApiFp(this.configuration).apiOrderinfoPagePost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 增加出库订单
     * @param {Orderinfo} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}  
     * @memberof WarehouseApi
     */
    public async apiOrderinfoAddPost(body?: OrderInfo, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiOrderinfoApiFp(this.configuration).apiOrderinfoAddPost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 修改出库订单
     * @param {Orderinfo} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiOrderinfoUpdatePost(body?: OrderInfo, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiOrderinfoApiFp(this.configuration).apiOrderinfoUpdatePost(body, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary 删除出库订单
     * @param {DeleteOrderinfoInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WarehouseApi
     */
    public async apiOrderinfoDeletePost(body?: DeleteOrderinfoInput, options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
        return apiOrderinfoApiFp(this.configuration).apiOrderinfoDeletePost(body, options).then((request) => request(this.axios, this.basePath));
    }
}

interface ResponseDate<T=any>{
    code:string,
    message:string,
    result:T
  }
/**
 * 导出文件操作
 * @param file 导出的文件对象
 * @returns 导出文件操作的响应结果  
 */
export  function OrderinfoexportApi(data:any,responseType:'blob'){


    return axiosInstance<Blob>({
        responseType:'blob',
        method:'post',
        url:BaseUrl+'/api/orderInfo/OrderExport',
        data,


    })
}

/** 
 * 导入文件操作
 * @param file 导入的文件对象
 * @returns 导入文件操作的响应结果
 */
export function OrderinfoinportApi(formData:any) {
    return axiosInstance<ResponseDate>({
      //responseType: 'blob',
      url: BaseUrl + '/api/orderInfo/ImportOrderinfo',
      method: 'POST',
      data: formData
    });
  }

  /** 
 * 下载接口
 * @param data 下载所需参数
 * @returns 下载文件的响应
 */
export function DownloadOrderinfoApi(params?: Record<string, any>)  {
    return axiosInstance<Blob>({
      responseType: 'blob',
      url: BaseUrl + '/api/orderInfo/DownloadOrderTemplate',
      method: 'POST',
      params
    });
  }

 /**
  * 批量删除
  * @param data 
  * @returns 
  */
 export function BatchDeleteOrderInfoApi(data:any[])  {
     return axiosInstance<ResponseDate>({
      // responseType: 'blob',
       url: BaseUrl + '/api/orderInfo/BatchDeleteOrderInfo',
       method: 'Delete',
       data
     });
   }
  